package com.slkj.shilixiaoyuanapp.net.service;

import com.slkj.shilixiaoyuanapp.entity.CollectEntity;
import com.slkj.shilixiaoyuanapp.entity.MyWageEntity;
import com.slkj.shilixiaoyuanapp.entity.TeacherInfoEntity;
import com.slkj.shilixiaoyuanapp.entity.UserEntity;
import com.slkj.shilixiaoyuanapp.entity.UserInfosEntity;
import com.slkj.shilixiaoyuanapp.entity.VersionEntity;
import com.slkj.shilixiaoyuanapp.entity.VersionHistoryEntity;
import com.slkj.shilixiaoyuanapp.entity.WagesNetEntity;
import com.slkj.shilixiaoyuanapp.net.CommonResult;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * Created  on 2018-07-30
 *
 * @author 唐开阔
 * @describe
 */
public interface UserService {

    @FormUrlEncoded
    @POST("home/loginAPP.do")
    Observable<CommonResult<UserEntity>> userLogin(@Field("username") String username, @Field("password") String password);

    /**
     * 获取老师基本信息
     * @return
     */
    @GET("PersonalCenter/selectUser.do")
    Observable<CommonResult<TeacherInfoEntity>> getUserInfo();


    @FormUrlEncoded
    @POST("PersonalCenter/updateHeadImg.do")
    Observable<CommonResult<String>> updateHeadImg( @Field("image") String img);


    @FormUrlEncoded
    @POST("PersonalCenter/updateNickName.do")
    Observable<CommonResult<String>> updateNikeName( @Field("name") String name);


    @FormUrlEncoded
    @POST("PersonalCenter/updatePassword.do")
    Observable<CommonResult<String>> updatePz( @Field("pwd") String pwd,@Field("password") String password,@Field("password1") String password1);


    /**
     * 绑定手机号 获取验证码
     * @param newPhone
     * @return
     */
    @FormUrlEncoded
    @POST("PersonalCenter/sendUpdatePhoneMessage.do")
    Observable<CommonResult<String>> getCode(@Field("newPhone") String newPhone);

    /**
     * 修改绑定手机号
     * @param authCode
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST("PersonalCenter/updatePhone.do")
    Observable<CommonResult<String>> updatePhone(@Field("authCode") String authCode,@Field("phone") String phone);


    @FormUrlEncoded
    @POST("my/historyVersion.do")
    Observable<CommonResult<List<VersionHistoryEntity>>> getHistoryVersion(@Field("type") int type);

    @FormUrlEncoded
    @POST("PersonalCenter/selectSalay1.do")
    Observable<CommonResult<MyWageEntity>> getWages(@Field("setTime") String setTime);


    @FormUrlEncoded
    @POST("collect/addCollect.do")
    Observable<CommonResult<String>> addCollect(@Field("id") int id,@Field("type") int type);


    @FormUrlEncoded
    @POST("collect/selectCollect.do")
    Observable<CommonResult<List<CollectEntity>>> getCollect( @Field("startId") int startId, @Field("page") int page, @Field("count") int count);


    @FormUrlEncoded
    @POST("PersonalCenter/add.do")
    Observable<CommonResult<String>> addYjfk( @Field("body") String body, @Field("schoolId") int schoolId, @Field("type") int type, @Field("postbox") String postbox);


    @FormUrlEncoded
    @POST("my/compareVersion.do")
    Observable<CommonResult<VersionEntity>> checkVersion(@Field("type") int type, @Field("version") String version  );

}
